class FeatureExtractor:
    @staticmethod
    def extract_features(cycle_data, current_cycle):
        """提取循环特征"""
        features = {
            "discharge_cap": cycle_data.get("放电容量(Ah)", [None] * (current_cycle + 1))[current_cycle],
            "efficiency": cycle_data.get("充放电效率(%)", [None] * (current_cycle + 1))[current_cycle],
            "retention": cycle_data.get("容量保持率(%)", [None] * (current_cycle + 1))[current_cycle],
            "mid_volt": cycle_data.get("中值电压(V)", [None] * (current_cycle + 1))[current_cycle],
            "cc_ratio": cycle_data.get("恒流充入比率(%)", [None] * (current_cycle + 1))[current_cycle],
            "discharge_energy": cycle_data.get("放电能量(Wh)", [None] * (current_cycle + 1))[current_cycle],
            "time": cycle_data.get("放电时间", [None] * (current_cycle + 1))[current_cycle],
            "current_diff": cycle_data.get("充电电流差值(A)", [None] * (current_cycle + 1))[current_cycle],
            "ratio_cap": cycle_data.get("放电比容量(mAh/g)", [None] * (current_cycle + 1))[current_cycle],
            "ratio_energy": cycle_data.get("放电比能量(mWh/g)", [None] * (current_cycle + 1))[current_cycle],
            "discharge_ratio": cycle_data.get("放电倍率(%)", [None] * (current_cycle + 1))[current_cycle],
            "net_cap": None
        }
        
        if features["time"] is not None:
            features["time"] = round(features["time"] / (1000 * 60 * 60), 6)
        
        if "净放电容量(Ah)" in cycle_data:
            features["net_cap"] = format(cycle_data["净放电容量(Ah)"][current_cycle], 'f')
            
        return features